<template>
  <div>
    <van-popup v-model="show">
      <div class="erweima">
        <p>姜月辉工作室</p>
        <img :src="erweimapic" alt="">
        <p>长按识别二维码关注公众号</p>
      </div>
    </van-popup>
    <div class="boominfo_head">
      <router-link to="/">
          <span>
               <img src="./../../../assets/img/icon-home.png" alt="">
               <p>姜月辉</p>
          </span>
      </router-link>
      <span>
        <router-link to="search">
          <img src="./../../../assets/img/sousuo.png" alt="">
        </router-link>
        <img src="./../../../assets/img/erweima.png" alt="" @click="erweima">
        <router-link to="mine">
          <img src="./../../../assets/img/wode.png" alt="">
        </router-link>
      </span>
    </div>
  </div>
</template>

<script>
import { Popup } from 'vant'
import Vue from 'vue'
import {getPublicAddress} from '@/api/fetch'


Vue.use(Popup)
export default {
  name: 'HeadOptions',
  data () {
    return {
      show: false,
      erweimapic:""
    }
  },
  methods: {
    erweima () {
      this.show = true
    },

    async getPublicAddress () {
      const res = await getPublicAddress()
      console.log(res)
      if(res.errcode == 0){
        this.erweimapic=res.data
      }
    },
  },
  activated() {
    this.getPublicAddress()
  }
}
</script>

<style lang="less" scoped>
  .erweima{
    width: 300px;
    height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
  img{
    width: 110px;
    height: 110px;
  }
  p:first-child{
    margin-top: 20px;
    color: orange;
    font-size: 16px;
  }
  p:last-child{
    margin-bottom: 20px;
    font-size: 12px;
    color: #acacac;
  }
  }
  .boominfo_head{
    z-index: 99;
    width: 100%;
    height: 40px;
    background: #f5efef;
    position: fixed;
    top: 0;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  span:first-child{
    display: flex;
    flex-direction: row;
    align-items: center;
    color: black;
  img{
    margin-right: 10px;
  }
  }
  span:last-child{
    margin-right: 15px;
  img{
    margin-left: 20px;
  }
  }
  img{
    width: 20px;
    height: 20px;
  }
  }
</style>
